Ext.define('DragonApp.view.operalog.Form', {
    extend: 'Ext.form.Panel',
    alias: ['widget.operalogform'],

    requires: [
        'DragonApp.view.operalog.OperatorCombobox',
        'DragonApp.view.operalog.OperationCombobox'
    ],

    controller: 'operalog',

    title: '查询表单',

    bodyPadding: 5,
    border: false,


    fieldDefaults: {
        labelWidth: 60,
        labelAlign: 'right'
    },

    items: [{
        xtype: 'fieldcontainer',
        layout: 'hbox',
        defaults: {
            listeners: {
                specialKey: 'onTextFieldSpecialKey'
            },
            margin: '0 10 0 0'
        },
        items: [
		    {   xtype: "operatorcombobox", name: "user", fieldLabel: "操作人", allowBlank: true, width: 238 },
			{
                xtype: "operacombobox",
                name: "opera_id",
                fieldLabel: "日志类型",
                selectChildren: false,
                canSelectFolders: true,
                allowBlank: false,
                width: 238
            },
            { xtype: "datefield", name: "startdate", fieldLabel: "开始日期", maxValue: new Date(), format: 'Y-m-d', emptyText: '请选择', width: 238 },
            { xtype: "datefield", name: "enddate", fieldLabel: "截止日期", value: new Date(), format: 'Y-m-d', emptyText: '请选择', width: 238 }
        ]
    }],
    buttons: [{
        text: '取消',
        handler: function() {

            //清空查询表单
            var form = this.up('form').getForm();
            form.reset();

            //清空查询内容
            var operalogGrid = Ext.ComponentQuery.query('operaloggrid')[0];
            var operalogStore = operalogGrid.getStore();
            operalogStore.removeAll();
        }
    }, {
        text: '查询',
        formBind: true,
        disabled: true,
        handler: 'onSubmitClick'
    }]
});